package cn.itlaobing.dao;

import cn.itlaobing.model.VegetableTypesModel;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;
import java.util.List;

/**
 * Created by Administrator on 2017-11-10.
 */
public class VTypeDao extends BaseDao {
    public List<VegetableTypesModel> QueryAll() throws SQLException {
        QueryRunner qr=new QueryRunner(getDataSource());
        String sql="SELECT * FROM vegetabletypes";
        BeanListHandler<VegetableTypesModel> beanListHandler=new BeanListHandler<VegetableTypesModel>(VegetableTypesModel.class);
        List<VegetableTypesModel> list=qr.query(sql,beanListHandler);
        return list;
    }
}
